//index.js
//获取应用实例
var app = getApp()
Page({
  data: {
    motto:"我校食堂",
    userInfo: {},
    user_head_s:"thom_header",
    flag:true,
  },
  //事件处理函数
  bindViewTap: function() {
    // wx.navigateTo({
    //   url: '../logs/logs'
    // })
    console.log(this.data.flag);
    console.log(this.data.user_head_s)
    
     this.setData({
        user_head_s:this.data.user_head_s === "thom_header"
        ?"userinfo-avatar"
        :"thom_header"
    })
  },
  onLoad: function () {
    // console.log('onLoad')
    var that = this
    // console.log(this.data.user_head_s)
    //调用应用实例的方法获取全局数据
    app.getUserInfo(function(userInfo){
      //更新数据
      that.setData({
        userInfo:userInfo
      })
    })
  }
})
